﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CustomConverters;

namespace ApplicationTest
{

    public class CBooleanToInt32 : CustomConverters.Converter<bool, Int32>
    {

        public override int Convert(bool value, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value)
                return 1;
            return 0;
        }

        public override bool ConvertBack(int value, object parameter, System.Globalization.CultureInfo culture)
        {
            return (value != 0);
        }
    }

}
